/**	
 * DroidKit is a toolkit for the Android platform
 * Copyright (C) 2012  Jonathan Bonazza
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 */

package com.droidkit.net;

import java.util.Date;

//This module is licensed and may be used under the terms of the
//GPL, GNU General Public License, V3 or later, http://www.gnu.org/licenses/gpl.html
//
//Please contact the author if you need another license.
//This module is provided "as is", without warranties of any kind.

/**
 * Container class to encapsulate an email message
 * 
 * Project home page: http://code.google.com/p/simple-net-comm/
 * Author: Jonathan Bonazza
 * License: GPL
 */
public class EmailMessage
{
	private String from;		//The source address
	private String replyTo;		//The reply-to address
	private String bcc;			//The BCC for the message
	private String cc;			//The CC for the message
	private String to;			//The destination address
	private String inReplyTo;	//The previous corresponence which this message answers
	private String references;	//The other correspondence which this message references
	private String keywords;	//Keywords or phrases seperated by commas
	private String comments;	//Text comments on the messgae; not a part of the body
	private Date date;			//The date and time the message was sent (timestamp)
	private String subject;		//The message subject
	private String body;		//The message body
	
	public EmailMessage(String from, String replyTo, String bcc, String cc, String to, String inReplyTo, String references,
			 String keywords, String comments, Date timestamp, String subj, String body)
	{
		this.from = from;
		this.replyTo = replyTo;
		this.bcc = bcc;
		this.cc = cc;
		this.to = to;
		this.inReplyTo = inReplyTo;
		this.references = references;
		this.keywords = keywords;
		this.comments = comments;
		this.date = timestamp;
		this.subject = subj;
		this.body = body;
	}
	
	//Accessor methods
	public String getFrom() { return from; }
	public String getReplyTo() { return replyTo; }
	public String getBCC() { return bcc; }
	public String getCC() { return cc; }
	public String getTo() { return to; }
	public String getInReplyTo() { return inReplyTo; }
	public String getReferences() { return references; }
	public String getKeywords() { return keywords; }
	public String getComments() { return comments; }
	public Date getTimestamp() { return date; }
	public String getSubject() { return subject; }
	public String getBody() { return body; }
	
	//Overriden toString()
	@Override
	public String toString()
	{
		return "From: " + from +
				"\nTo: " + to +
				"\nDate: " + date.toString() +
				"\nSubject: " + subject +
				"\n" + body + "\n";
	}
}

